package top.wbhzx.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.wbhzx.mapper.UserMapper;
import top.wbhzx.pojo.User;
import top.wbhzx.service.UserService;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserMapper userMapper;
	@Override
	public User selOneById(Integer id) {
		return userMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<User> selListByPo(User po) {
		return userMapper.selectListByPo(po);
	}

	@Override
	public Integer addOne(User po) {
		Integer i = userMapper.insertSelective(po);
		return i;
	}

	@Override
	public Integer modifyOnById(User po) {
		Integer i = userMapper.updateByPrimaryKeySelective(po);
		return i;
	}

	@Override
	public Integer modifyListById(Integer[] ids, User object) {
		//未定
		return null;
	}

	@Override
	public Integer removeOneById(Integer id) {
		Integer i = userMapper.deleteByPrimaryKey(id);
		return i;
	}

	@Override
	public Integer removeListById(Integer[] ids) {
		Integer i = userMapper.deleteListByPrimaryKey(ids);
		return i;
	}
	

}
